using System.ComponentModel.DataAnnotations;

namespace ERP.RepositoryManage.Dtos
{
    /// <summary>
    /// 更新装箱明细DTO
    /// </summary>
    public class UpdatePackingDetailDto
    {
        /// <summary>
        /// 明细ID
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 装箱ID
        /// </summary>
        public int PackingId { get; set; }

        /// <summary>
        /// 生产工单ID
        /// </summary>
        public int WorkOrderId { get; set; }

        /// <summary>
        /// 生产工单编号
        /// </summary>
        [Required(ErrorMessage = "生产工单编号不能为空")]
        [StringLength(50, ErrorMessage = "生产工单编号长度不能超过50个字符")]
        public string WorkOrderCode { get; set; } = string.Empty;

        /// <summary>
        /// 物料编码
        /// </summary>
        [Required(ErrorMessage = "物料编码不能为空")]
        [StringLength(50, ErrorMessage = "物料编码长度不能超过50个字符")]
        public string MaterialCode { get; set; } = string.Empty;

        /// <summary>
        /// 物料名称
        /// </summary>
        [Required(ErrorMessage = "物料名称不能为空")]
        [StringLength(100, ErrorMessage = "物料名称长度不能超过100个字符")]
        public string MaterialName { get; set; } = string.Empty;

        /// <summary>
        /// 计划数量
        /// </summary>
        public decimal PlannedQuantity { get; set; }

        /// <summary>
        /// 实际数量
        /// </summary>
        [Required(ErrorMessage = "实际数量不能为空")]
        [Range(0.01, double.MaxValue, ErrorMessage = "实际数量必须大于0")]
        public decimal ActualQuantity { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        [StringLength(20, ErrorMessage = "单位长度不能超过20个字符")]
        public string Unit { get; set; } = string.Empty;

        /// <summary>
        /// 批次
        /// </summary>
        [StringLength(50, ErrorMessage = "批次长度不能超过50个字符")]
        public string Batch { get; set; } = string.Empty;

        /// <summary>
        /// 规格型号
        /// </summary>
        [StringLength(100, ErrorMessage = "规格型号长度不能超过100个字符")]
        public string Specifications { get; set; } = string.Empty;

        /// <summary>
        /// 备注
        /// </summary>
        [StringLength(500, ErrorMessage = "备注长度不能超过500个字符")]
        public string? Remark { get; set; }
    }
} 